//    Copyright (C) 2013  <lugocreation@gmail.com>
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>
package org.jpgolay.wi.customer;

import java.io.Serializable;

public class Customer
        implements Serializable {

    public Customer() {
    }

    public Customer(Integer id, String status, String firstname, String lastname, String addrLn1, String addrLn2, String zip,
            String city, String country, String cardNumber, String state, String cardName, String cardExpiryDate, String cardDigiCode,
            String tel, String cel, String fax, String bankNumber, String paymentBy, String notes, String email,
            String www, String bank, Integer salesPersonId, String lastUserId, String lastTime) {
        setId(id);
        setStatus(status);
        setFirstname(firstname);
        setLastname(lastname);
        setAddrLn1(addrLn1);
        setAddrLn2(addrLn2);
        setZip(zip);
        setCity(city);
        setCountry(country);
        setCardNumber(cardNumber);
        setState(state);
        setCardName(cardName);
        setCardExpiryDate(cardExpiryDate);
        setCardDigiCode(cardDigiCode);
        setTel(tel);
        setCel(cel);
        setFax(fax);
        setBankNumber(bankNumber);
        setPaymentBy(paymentBy);
        setNotes(notes);
        setEmail(email);
        setWww(www);
        setBank(bank);
        setSalesPersonId(salesPersonId);
        setLastUserId(lastUserId);
        setLastTime(lastTime);
    }

    public Customer(Customer customer) {
        setId(customer.getId());
        setStatus(customer.getStatus());
        setFirstname(customer.getFirstname());
        setLastname(customer.getLastname());
        setAddrLn1(customer.getAddrLn1());
        setAddrLn2(customer.getAddrLn2());
        setZip(customer.getZip());
        setCity(customer.getCity());
        setCountry(customer.getCountry());
        setCardNumber(customer.getCardNumber());
        setState(customer.getState());
        setCardName(customer.getCardName());
        setCardExpiryDate(customer.getCardExpiryDate());
        setCardDigiCode(customer.getCardDigiCode());
        setTel(customer.getTel());
        setCel(customer.getCel());
        setFax(customer.getFax());
        setBankNumber(customer.getBankNumber());
        setPaymentBy(customer.getPaymentBy());
        setNotes(customer.getNotes());
        setEmail(customer.getEmail());
        setWww(customer.getWww());
        setBank(customer.getBank());
        setSalesPersonId(customer.getSalesPersonId());
        setLastUserId(customer.getLastUserId());
        setLastTime(customer.getLastTime());
    }

    public Integer getId() {
        return id;
    }

    public String getStatus() {
        return status;
    }

    public String getFirstname() {
        return firstname;
    }

    public String getLastname() {
        return lastname;
    }

    public String getAddrLn1() {
        return addrLn1;
    }

    public String getCity() {
        return city;
    }

    public String getCountry() {
        return country;
    }

    public String getCardNumber() {
        return cardNumber;
    }

    public String getTel() {
        return tel;
    }

    public String getCel() {
        return cel;
    }

    public String getFax() {
        return fax;
    }

    public String getBankNumber() {
        return bankNumber;
    }

    public String getPaymentBy() {
        return paymentBy;
    }

    public String getNotes() {
        return notes;
    }

    public String getEmail() {
        return email;
    }

    public String getWww() {
        return www;
    }

    public String getBank() {
        return bank;
    }

    public String getLastTime() {
        return lastTime;
    }

    public String getLastUserId() {
        return lastUserId;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    public void setLastname(String lastname) {
        this.lastname = lastname;
    }

    public void setAddrLn1(String addrLn1) {
        this.addrLn1 = addrLn1;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public void setCardNumber(String cardNumber) {
        this.cardNumber = cardNumber;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public void setCel(String cel) {
        this.cel = cel;
    }

    public void setFax(String fax) {
        this.fax = fax;
    }

    public void setBankNumber(String bankNumber) {
        this.bankNumber = bankNumber;
    }

    public void setPaymentBy(String paymentBy) {
        this.paymentBy = paymentBy;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public void setWww(String www) {
        this.www = www;
    }

    public void setBank(String bank) {
        this.bank = bank;
    }

    public void setLastTime(String lastTime) {
        this.lastTime = lastTime;
    }

    public void setLastUserId(String lastUserId) {
        this.lastUserId = lastUserId;
    }

    public String getAddrLn2() {
        return addrLn2;
    }

    public Integer getSalesPersonId() {
        return salesPersonId;
    }

    public String getState() {
        return state;
    }

    public String getCardDigiCode() {
        return cardDigiCode;
    }

    public String getCardExpiryDate() {
        return cardExpiryDate;
    }

    public String getCardName() {
        return cardName;
    }

    public void setAddrLn2(String addrLn2) {
        this.addrLn2 = addrLn2;
    }

    public void setSalesPersonId(Integer salesPersonId) {
        this.salesPersonId = salesPersonId;
    }

    public void setState(String state) {
        this.state = state;
    }

    public void setCardDigiCode(String cardDigiCode) {
        this.cardDigiCode = cardDigiCode;
    }

    public void setCardExpiryDate(String cardExpiryDate) {
        this.cardExpiryDate = cardExpiryDate;
    }

    public void setCardName(String cardName) {
        this.cardName = cardName;
    }

    public String getZip() {
        return zip;
    }

    public void setZip(String adresseLivrDeux) {
        zip = adresseLivrDeux;
    }

    public String toString() {
        StringBuffer str = new StringBuffer("{");
        str.append("id=" + getId() + " " + "status=" + getStatus() + " " + "firstname=" + getFirstname() + " " + "lastname=" + getLastname() + " " + "addrLn1=" + getAddrLn1() + " " + "addrLn2=" + getAddrLn2() + " " + "zip=" + getZip() + " " + "city=" + getCity() + " " + "country=" + getCountry() + " " + "cardNumber=" + getCardNumber() + " " + "state=" + getState() + " " + "cardName=" + getCardName() + " " + "cardExpiryDate=" + getCardExpiryDate() + " " + "cardDigiCode=" + getCardDigiCode() + " " + "tel=" + getTel() + " " + "cel=" + getCel() + " " + "fax=" + getFax() + " " + "bankNumber=" + getBankNumber() + " " + "paymentBy=" + getPaymentBy() + " " + "notes=" + getNotes() + " " + "email=" + getEmail() + " " + "www=" + getWww() + " " + "bank=" + getBank() + " " + "salesPersonId=" + getSalesPersonId() + " " + "lastUserId=" + getLastUserId() + " " + "lastTime=" + getLastTime());
        str.append('}');
        return str.toString();
    }

    public boolean equals(Object pOther) {
        if (pOther instanceof Customer) {
            Customer lTest = (Customer) pOther;
            boolean lEquals = true;
            if (id == null) {
                lEquals = lEquals && lTest.id == null;
            } else {
                lEquals = lEquals && id.equals(lTest.id);
            }
            if (status == null) {
                lEquals = lEquals && lTest.status == null;
            } else {
                lEquals = lEquals && status.equals(lTest.status);
            }
            if (firstname == null) {
                lEquals = lEquals && lTest.firstname == null;
            } else {
                lEquals = lEquals && firstname.equals(lTest.firstname);
            }
            if (lastname == null) {
                lEquals = lEquals && lTest.lastname == null;
            } else {
                lEquals = lEquals && lastname.equals(lTest.lastname);
            }
            if (addrLn1 == null) {
                lEquals = lEquals && lTest.addrLn1 == null;
            } else {
                lEquals = lEquals && addrLn1.equals(lTest.addrLn1);
            }
            if (addrLn2 == null) {
                lEquals = lEquals && lTest.addrLn2 == null;
            } else {
                lEquals = lEquals && addrLn2.equals(lTest.addrLn2);
            }
            if (zip == null) {
                lEquals = lEquals && lTest.zip == null;
            } else {
                lEquals = lEquals && zip.equals(lTest.zip);
            }
            if (city == null) {
                lEquals = lEquals && lTest.city == null;
            } else {
                lEquals = lEquals && city.equals(lTest.city);
            }
            if (country == null) {
                lEquals = lEquals && lTest.country == null;
            } else {
                lEquals = lEquals && country.equals(lTest.country);
            }
            if (cardNumber == null) {
                lEquals = lEquals && lTest.cardNumber == null;
            } else {
                lEquals = lEquals && cardNumber.equals(lTest.cardNumber);
            }
            if (state == null) {
                lEquals = lEquals && lTest.state == null;
            } else {
                lEquals = lEquals && state.equals(lTest.state);
            }
            if (cardName == null) {
                lEquals = lEquals && lTest.cardName == null;
            } else {
                lEquals = lEquals && cardName.equals(lTest.cardName);
            }
            if (cardExpiryDate == null) {
                lEquals = lEquals && lTest.cardExpiryDate == null;
            } else {
                lEquals = lEquals && cardExpiryDate.equals(lTest.cardExpiryDate);
            }
            if (tel == null) {
                lEquals = lEquals && lTest.tel == null;
            } else {
                lEquals = lEquals && tel.equals(lTest.tel);
            }
            if (cel == null) {
                lEquals = lEquals && lTest.cel == null;
            } else {
                lEquals = lEquals && cel.equals(lTest.cel);
            }
            if (fax == null) {
                lEquals = lEquals && lTest.fax == null;
            } else {
                lEquals = lEquals && fax.equals(lTest.fax);
            }
            if (bankNumber == null) {
                lEquals = lEquals && lTest.bankNumber == null;
            } else {
                lEquals = lEquals && bankNumber.equals(lTest.bankNumber);
            }
            if (paymentBy == null) {
                lEquals = lEquals && lTest.paymentBy == null;
            } else {
                lEquals = lEquals && paymentBy.equals(lTest.paymentBy);
            }
            if (notes == null) {
                lEquals = lEquals && lTest.notes == null;
            } else {
                lEquals = lEquals && notes.equals(lTest.notes);
            }
            if (email == null) {
                lEquals = lEquals && lTest.email == null;
            } else {
                lEquals = lEquals && email.equals(lTest.email);
            }
            if (www == null) {
                lEquals = lEquals && lTest.www == null;
            } else {
                lEquals = lEquals && www.equals(lTest.www);
            }
            if (bank == null) {
                lEquals = lEquals && lTest.bank == null;
            } else {
                lEquals = lEquals && bank.equals(lTest.bank);
            }
            if (lastUserId == null) {
                lEquals = lEquals && lTest.lastUserId == null;
            } else {
                lEquals = lEquals && lastUserId.equals(lTest.lastUserId);
            }
            if (lastTime == null) {
                lEquals = lEquals && lTest.lastTime == null;
            } else {
                lEquals = lEquals && lastTime.equals(lTest.lastTime);
            }
            if (cardDigiCode == null) {
                lEquals = lEquals && lTest.cardDigiCode == null;
            } else {
                lEquals = lEquals && cardDigiCode.equals(lTest.cardDigiCode);
            }
            if (salesPersonId == null) {
                lEquals = lEquals && lTest.salesPersonId == null;
            } else {
                lEquals = lEquals && salesPersonId.equals(lTest.salesPersonId);
            }
            return lEquals;
        } else {
            return false;
        }
    }

    public int hashCode() {
        int result = 17;
        result = 37 * result + (id == null ? 0 : id.hashCode());
        result = 37 * result + (status == null ? 0 : status.hashCode());
        result = 37 * result + (firstname == null ? 0 : firstname.hashCode());
        result = 37 * result + (lastname == null ? 0 : lastname.hashCode());
        result = 37 * result + (addrLn1 == null ? 0 : addrLn1.hashCode());
        result = 37 * result + (addrLn2 == null ? 0 : addrLn2.hashCode());
        result = 37 * result + (zip == null ? 0 : zip.hashCode());
        result = 37 * result + (city == null ? 0 : city.hashCode());
        result = 37 * result + (country == null ? 0 : country.hashCode());
        result = 37 * result + (cardNumber == null ? 0 : cardNumber.hashCode());
        result = 37 * result + (state == null ? 0 : state.hashCode());
        result = 37 * result + (cardName == null ? 0 : cardName.hashCode());
        result = 37 * result + (cardExpiryDate == null ? 0 : cardExpiryDate.hashCode());
        result = 37 * result + (tel == null ? 0 : tel.hashCode());
        result = 37 * result + (cel == null ? 0 : cel.hashCode());
        result = 37 * result + (fax == null ? 0 : fax.hashCode());
        result = 37 * result + (bankNumber == null ? 0 : bankNumber.hashCode());
        result = 37 * result + (paymentBy == null ? 0 : paymentBy.hashCode());
        result = 37 * result + (notes == null ? 0 : notes.hashCode());
        result = 37 * result + (email == null ? 0 : email.hashCode());
        result = 37 * result + (www == null ? 0 : www.hashCode());
        result = 37 * result + (bank == null ? 0 : bank.hashCode());
        result = 37 * result + (lastUserId == null ? 0 : lastUserId.hashCode());
        result = 37 * result + (lastTime == null ? 0 : lastTime.hashCode());
        result = 37 * result + (cardDigiCode == null ? 0 : cardDigiCode.hashCode());
        result = 37 * result + (salesPersonId == null ? 0 : salesPersonId.hashCode());
        return result;
    }
    private Integer id;
    private String status;
    private String firstname;
    private String lastname;
    private String addrLn1;
    private String addrLn2;
    private String zip;
    private String city;
    private String state;
    private String country;
    private String tel;
    private String cel;
    private String fax;
    private String email;
    private String www;
    private String bank;
    private String bankNumber;
    private String paymentBy;
    private String cardName;
    private String cardNumber;
    private String cardExpiryDate;
    private String cardDigiCode;
    private String notes;
    private String lastUserId;
    private String lastTime;
    private Integer salesPersonId;
}
